package com.dz.risk.pojo.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dz.risk.validation.Add;
import com.dz.risk.validation.Update;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 债卷-违约债券名单
 *
 * @author Doke
 * @date 2021/07/07 13:57:15
 */
@ApiModel(value = "ListOfDefaultedBonds : 违约债券名单实体")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@Builder
@TableName(value = "t_st_list_of_defaulted_bonds")
public class ListOfDefaultedBonds {
    /**
     * id
     */
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "id主键")
    @NotBlank(message = "债券Id不能为空", groups = {Update.class})
    private String id;

    /**
     * 债券
     */
    @NotBlank(message = "债券名称不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty(value = "债券名称", required = true)
    private String bondName;

    /**
     * 代码
     */
    @NotBlank(message = "代码不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty(value = "代码", required = true)
    private String bondCode;

    /**
     * 违约开始日期
     */
    @NotNull(message = "违约开始日期不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty(value = "违约开始日期", required = true)
    private Long beginDate;

    /**
     * 违约结束日期
     */
    @NotNull(message = "违约结束日期不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty(value = "违约结束日期", required = true)
    private Long endDate;

    /**
     * 账面余额
     */
    @NotNull(message = "账面余额不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty(value = "账面余额", required = true)
    private BigDecimal bookBalance;

    /**
     * 已计提减值准备
     */
    @NotNull(message = "已计提减值准备不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty(value = "已计提减值准备", required = true)
    private BigDecimal impairmentProvisionsHaveBeenSetAside;

    /**
     * 账面价值
     */
    @ApiModelProperty(value = "账面价值", required = true)
    private BigDecimal bookValue;

    /**
     * 创建时间
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "创建时间")
    private Date createdTime;

    /**
     * 更新时间
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "更新时间")
    private Date updatedTime;

    /**
     * 创建人
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "创建人")
    private String createdUser;

    /**
     * 更新人
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "更新人")
    private String updatedUser;
}